// Copyright 2022 jeff.li. and/or its affiliates.

#include <gtest/gtest.h>
#include <tbir/runtime/container.h>

namespace tbir::runtime {

    TEST(Kwargs, Constructor) {
        Kwargs kwargs1{};
        Kwargs kwargs2{{"name", "abc"}};
        Kwargs kwargs3{{"name", "abc"},
                       {"age",  16}};
    }

    TEST(Kwargs, len) {
        Kwargs kwargs{{"name", "abc"},
                      {"age",  16}};
        EXPECT_EQ(kwargs.size(), 2);
    }

    TEST(Kwargs, contains) {
        Kwargs kwargs{{"name", "abc"},
                      {"age",  16}};
        EXPECT_TRUE(kwargs.contains("name"));
        EXPECT_TRUE(kwargs.contains("age"));
        EXPECT_FALSE(kwargs.contains("hello"));
    }

    TEST(Kwargs, get_item) {
        Kwargs kwargs{{"name", "abc"},
                      {"age",  16}};
        EXPECT_EQ(kwargs.get_item("name"), "abc");
        EXPECT_EQ(kwargs.get_item("age"), 16);
    }

}  // namespace tbir::runtime
